package com.nervenets.shopping.hibernate.domain.common;

import com.nervenets.general.adapter.jsonType.StringArrayJson;
import com.nervenets.general.hibernate.DomainObject;
import com.nervenets.shopping.enumeration.UnionType;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Type;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * 投诉建议
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Table
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Feedback extends DomainObject {
    @ApiModelProperty(value = "关联类型")
    private UnionType unionType;
    @ApiModelProperty(value = "关联ID")
    private long unionId;
    @ApiModelProperty(value = "内容")
    private String content;
    @ApiModelProperty(value = "图片")
    @Type(type = StringArrayJson.NAME)
    @Column(columnDefinition = "json")
    private List<String> images;
    @Transient
    @ApiModelProperty(value = "关联对象")
    private Object union;
    @ApiModelProperty(value = "处理时间")
    private long handleTime;
    @ApiModelProperty(value = "处理人")
    private long handleUserId;
    @ApiModelProperty(value = "处理备注")
    private String handleRemark;

    /*以下是附加需要的内容*/
    @Transient
    @ApiModelProperty(value = "创建人名称")
    private String createUserName;
    @ApiModelProperty(value = "创建人头像")
    private String createUserAvatar;
    @Transient
    @ApiModelProperty(value = "处理人名称")
    private String handleUserName;
}
